// FPSTest.cpp: implementation of the FPSTest class.
//
//////////////////////////////////////////////////////////////////////

#include "FPSTest.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

FPSTest::FPSTest()
{
this->t				= 0.0f;
this->dt			= 0.0f;
this->frameNumber	= 0;
this->time			= 0.0f;
this->fps			= 0.0f;
}

FPSTest::~FPSTest()
{

}

float FPSTest::test()
{
this->frameNumber++;

this->ck . update () ;

this->t = this->ck . getAbsTime   () ;
this->dt = (float)this->ck . getDeltaTime () ;

this->time += this->dt;

if(this->frameNumber == NUM_FRAMES_FOR_TEST)
	{
	this->fps	= (float)this->frameNumber / this->time;
	this->frameNumber = 0;
	this->time  = 0.0f;
	}

return this->fps;
}
